#!/bin/sh
#
# Copyright (C) 2016 NatShell.com
#

[ -e /etc/config/initdone  ] && exit 0

. /lib/functions.sh
. /lib/ar71xx.sh

generate_our_system(){
	uci -q batch <<-EOF
		delete system.@system[0]
		add system system
		set system.@system[-1].hostname='ACU'
		set system.@system[-1].timezone='CST-8'
		set system.@system[-1].zonename='Asia/Shanghai'
		set system.@system[-1].ttylogin='0'
		set system.@system[-1].log_size='64'
		set system.@system[-1].urandom_seed='0'

		delete system.ntp
		set system.ntp='timeserver'
		set system.ntp.enabled='1'
		set system.ntp.enable_server='0'
		add_list system.ntp.server='ntp1.aliyun.com'
		add_list system.ntp.server='ntp2.aliyun.com'
		add_list system.ntp.server='ntp3.aliyun.com'
		add_list system.ntp.server='ntp4.aliyun.com'
	EOF
}

board=$(ar71xx_board_name)

case "$board" in
	
*)
	generate_our_system
	;;
esac

uci commit system
exit 0
